package jdbc;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;

public class JDBCDemo2 {
    public static void main(String[] args) throws Exception {
        Connection connection=DBUtil.getConnection();
        Statement statement = connection.createStatement();
        /*
        INSERT INTO user(username,password,nickname,age)
        VALUES('张三','12344','阿三',22)
         */
        String sql="INSERT INTO user(username,password,nickname,age)\n" +
                "        VALUES('张三','12344','阿三',22)";
        int num=statement.executeUpdate(sql);
        System.out.println("插入完毕影响了"+num+"条数据");
        connection.close();
    }
}
